<template>
  <div class="demo-title">search-bar/demo1</div>
  <div class="demo">
    <div class="radio">
      <div class="radio-item" @click="shape='square'">
        <img :src="shape==='square' ? selPng : unselPng">
        <span>square</span>
      </div>
      <div class="radio-item" @click="shape='round'">
        <img :src="shape==='round' ? selPng : unselPng">
        <span>round</span>
      </div>
    </div>
    <SearchBar v-model="val" :shape="shape" />
  </div>
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  import SearchBar from '@sscd-mobile/search-bar'
  const selPng = 'https://ssc-design-1311112663.cos.ap-guangzhou.myqcloud.com/components/h5/search-bar/sel.png'
  const unselPng = 'https://ssc-design-1311112663.cos.ap-guangzhou.myqcloud.com/components/h5/search-bar/unsel.png'
  const shape = ref('square')
  const val = ref('')
</script>

<style lang="less" scoped>
  .demo {
    padding-bottom: 12px;
    background-color: #fff;
    .radio {
      display: flex;
      flex-direction: row;
      margin-left: 10px;
      margin-bottom: 10px;
      .radio-item {
        margin-top: 10px;
        margin-left: 10px;
        width: 80rpx;
        height: 80rpx;
        color: black;
        display: flex;
        align-items: center;
        img {
          width: 20px;
          height: 20px;
        }
        span {
          height: 20px;
          line-height: 20px;
          margin-left: 6px;
        }
      }
    }
  }
</style>
